package homework.day01.controller;

import homework.day01.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.Scanner;

@Component
public class UserController {
    @Autowired
    private UserService userService;

    public void start() {
        System.out.println("请输入序号：（1.注册,2.登录）");
        Scanner sc = new Scanner(System.in);
        int num = Integer.parseInt(sc.nextLine());
        switch (num) {
            case 1:
                userService.register();
                break;
            case 2:
                userService.login();
                break;
            default:
                System.out.println("听话！咱只输入1或2，不输入其他的！ ^_^");
        }
    }
}
